﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace CurlingServer
{
    [ServiceContract]
    public interface ICurlingService
    {
        [OperationContract]
        string SetStatusOnline(PlayerProfile playerProfile, string ClientVersion);

        [OperationContract]
        void SetStatusOffline(string AuthToken);

        [OperationContract]
        //[FaultContract(typeof(UnauthorizedAccessFault))]
        List<PlayerProfile> GetUsersOnline(string AuthToken, bool EmptyIfNotChanged);

        [OperationContract]
        TimeSpan? GetLastVisitorInterval(string AuthToken);

        [OperationContract]
        int GetAlreadyPlayingCount(string AuthToken);

        [OperationContract]
        void ChooseOpponent(string AuthToken, string OpponentID);

        [OperationContract]
        PlayerProfile CheckRequests(string AuthToken);

        [OperationContract]
        void ProcessRequest(string AuthToken, string OpponentID, bool Accept);

        [OperationContract]
        bool? CheckRequestResult(string AuthToken, string OpponentID);

        [OperationContract]
        bool? IsIamFirstPlayer(string AuthToken);

        [OperationContract]
        void UploadData(string AuthToken, string OpponentID, string GameDataXml);

        [OperationContract]
        string DownloadData(string AuthToken);
    }
}
